import 'dart:convert';

import 'package:flutter_test/flutter_test.dart';
import 'package:im_app/im/socket/dto/business/PullData.dart';
import 'package:im_app/im/socket/dto/business/SendData.dart';

void main() {
  test("encode pull message", () {
    GroupInfoListItem groupInfoListItem = GroupInfoListItem.fromJson
      ({"groupInfoItemList":[{"groupId":"bca89072-8fbc-4b7f-9bfc-2b36b77220d2",
      "groupName":"demo!!!!","ownerId":"曹操","groupDesc":"3333333333333333333333333","status":1,"firstLetter":"2"}]});

    print("data json : $groupInfoListItem");
  });

  test('decode group info', () {
    var json = {"groupInfoItem":{"groupId":"09a74533-9f94-4abe-be6c-158e22f90002","groupName":"22222222","ownerId":"刘"
        "备","groupDesc":"141234","groupUserSet":[{"userId":"曹操","isShowName":true,"isWaking":true,"isTop":false,"isDisturb":true,"status":1},{"userId":"张飞","isShowName":true,"isWaking":true,"isTop":false,"isDisturb":true,"status":1},{"userId":"刘备","isShowName":true,"isWaking":true,"isTop":false,"isDisturb":true,"status":1},{"userId":"吕禄","isShowName":true,"isWaking":true,"isTop":false,"isDisturb":true,"status":1},{"userId":"周文王","isShowName":true,"isWaking":true,"isTop":false,"isDisturb":true,"status":1}],"status":1,"firstLetter":"2"},"createDateTime":"2024-09-20 21:28:28"};

    var serverGroupInfoReq = ServerSendGroupInfoReq.fromJson(json);
    var jsonStr = serverGroupInfoReq.toJson();
    var json1 = jsonEncode(json);
    print('json: $jsonStr');
  });
}